package com.gongren.project.job.odd;

import com.alibaba.dubbo.config.annotation.Reference;
import com.gongren.project.odd.job.rpc.api.service.taskRpc.IBillCallbackTaskRpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author houzhong
 * @Date 2017/9/1 12:34
 */
//@Component("billCallbackTask")
public class BillCallbackTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(BillCallbackTask.class);

    @Reference
    private IBillCallbackTaskRpcService billCallbackTaskRpcService;

    /**
     * 每5秒触发一次，更新提现手续费状态，更新订单状态异常
     */
    @Scheduled(cron = "*/5 * * * * ?")
    public void excuteTask(){

        LOGGER.info("BillCallbackTask and excuteTask start");
        try {
            billCallbackTaskRpcService.findAllExcuteTask();

            LOGGER.info("BillCallbackTask and excuteTask end");
        } catch (Exception e) {
            LOGGER.error("定时执行设置任务为过期任务：{}", e);
        }

    }

}
